package la.iok.hzsvn.lewin.movie.core.shopmovie.vo;

import la.iok.hzsvn.lewin.movie.core.model.CouponBase;
import la.iok.hzsvn.share.collection.IdAble;

import java.util.Objects;

/**
 * 优惠券定义
 * @since 1.1.1
 */
public class CouponDefinitionVo extends CouponBase implements IdAble<Long> {
    private Long id;
    /**
     * 定义优惠卷的店铺。如果是系统预定义的优惠卷，那就是-1，这些优惠卷所有店铺都可以使用。如果是店铺自己定义的优惠卷，那只有店铺自己可以使用
     */
    private Long orgUnitId;
    /**
     * 店铺名称
     */
    private String orgUnitName;
    /**
     * 优惠券适用的剧本类别.如果是-1，则不限制适用的剧本类别。
     */
    private Long movieLevelId;
    /**
     * 优惠券适用的剧本类别名称
     */
    private String movieLevelName;
    /**
     * 最大抵扣金额。当是折扣券的时候,根据使用的实际金额，以百分比进行抵扣，如果计算的抵扣金额大于最大抵扣金额,则只能以最大抵扣金额进行抵扣
     */
    private Integer maxAmount;

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrgUnitId() {
        return orgUnitId;
    }

    public void setOrgUnitId(Long orgUnitId) {
        this.orgUnitId = orgUnitId;
    }

    public String getOrgUnitName() {
        return orgUnitName;
    }

    public void setOrgUnitName(String orgUnitName) {
        this.orgUnitName = orgUnitName;
    }

    public Long getMovieLevelId() {
        return movieLevelId;
    }

    public void setMovieLevelId(Long movieLevelId) {
        this.movieLevelId = movieLevelId;
    }

    public String getMovieLevelName() {
        return movieLevelName;
    }

    public void setMovieLevelName(String movieLevelName) {
        this.movieLevelName = movieLevelName;
    }

    public Integer getMaxAmount() {
        return maxAmount;
    }

    public void setMaxAmount(Integer maxAmount) {
        this.maxAmount = maxAmount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CouponDefinitionVo)) return false;
        if (!super.equals(o)) return false;
        CouponDefinitionVo that = (CouponDefinitionVo) o;
        return Objects.equals(id, that.id) && Objects.equals(orgUnitId, that.orgUnitId) && Objects.equals(orgUnitName, that.orgUnitName) && Objects.equals(movieLevelId, that.movieLevelId) && Objects.equals(movieLevelName, that.movieLevelName) && Objects.equals(maxAmount, that.maxAmount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), id, orgUnitId, orgUnitName, movieLevelId, movieLevelName, maxAmount);
    }

    @Override
    public String toString() {
        return "CouponDefinitionVo{" +
                "id=" + id +
                ", name='" + getName() + '\'' +
                ", orgUnitId=" + orgUnitId +
                ", orgUnitName='" + orgUnitName + '\'' +
                ", type=" + getType() +
                ", amount=" + getAmount() +
                ", movieLevelId=" + movieLevelId +
                ", movieLevelName='" + movieLevelName + '\'' +
                ", maxAmount=" + maxAmount +
                '}';
    }
}
